#ifndef CTIMER
#define CTIMER
#include <cppcommon.h>
#include <CValue.h>
class CTimer
{
private:
	enum ETimeStrState
	{
		INIT,
		YEAR,
		MONTH,
		DAY,
		HOUR,
		MINUTE,
		SECOND,
		OTHER,
		END
	};
	STRING m_CommandStr;
	INT m_TimerValue;
#ifdef _LIBCOMMON
	PSTR analy(ETimeStrState& _State, PSTR _star);
	bool input(INT _intValue);
	bool input(INT _intValue,STRING _Command);
	bool input(STRING _strValue);
	bool input(STRING _strValue,STRING _Command);
#endif
public:
#ifdef _LIBCOMMON
	CTimer();
	CTimer(STRING _cmdStr);
#endif
	virtual ~CTimer();
	virtual CTimer& operator = (const INT& _intValue);
	virtual void setCommand(STRING _Command);
	bool fromNumber(CValue _CValue);
	bool fromNumber(CValue _CValue, STRING _Command);
	bool fromString(CValue _CValue);
	bool fromString(CValue _CValue, STRING _Command);
	virtual CValue& output();
	virtual CValue& output(STRING _Command);
	virtual INT getValue();
};


#ifdef _MSC_VER
#ifdef _LIBCOMMON
#define _DLLFUNC __declspec(dllexport)
#else
#define _DLLFUNC __declspec(dllimport)
#endif
#else
#define _DLLFUNC
#endif

typedef CTimer* PCTimer;
typedef PCTimer (*PCreateNewCTimerNULL)();
typedef PCTimer (*PCreateNewCTimerStr)(STRING _cmdStr);
extern "C" _DLLFUNC PCTimer CreateNewCTimerNULL();
extern "C" _DLLFUNC PCTimer CreateNewCTimerStr(STRING _cmdStr);
extern "C" _DLLFUNC void Test();




#endif




